using LuceneSearch.ContactApp.Indexing;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;

namespace LuceneSearch.ContactApp.Bootstrapping
{
    public class ObjectRegisty : Registry
    {
        public ObjectRegisty()
        {
            ForRequestedType<IndexDirectoryProvider>()
                .TheDefaultIsConcreteType<IndexDirectoryProvider>().AsSingletons();

            Scan(x =>
                     {
                         x.TheCallingAssembly();
                         x.AddAllTypesOf<IEntityIndexProcessor>();
                         x.With<DefaultConventionScanner>();
                     });
        }
    }
}